package pub.tbc.api.config;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.ConcurrentHashMap;

/**
 * @author tbc on 2017/3/2 17:23:44.
 */
@Slf4j
public class ConfigFactory {
    private static ConcurrentHashMap<String, AbstractConfiguration> instances = new ConcurrentHashMap<>();
    private static RouterConfiguration routerConfiguration;

    /**
     * 只有主线程需要，不考虑线程安全，若有其它线程可能用到，也只能是主线程初始化之后的事了
     *
     * @return ApplicationConfig
     */
    public static RouterConfiguration getRouterConfiguration() {
        if (routerConfiguration == null) {
            routerConfiguration = new RouterConfiguration();
        }
        return routerConfiguration;
    }

}
